﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;

namespace devtm.Aop.Extensions
{

    public static class ParameterDefinitionExt
    {


        public static ParameterDefinition Clone(this ParameterDefinition pd, TypeReference template, TypeDefinition target)
        {
            return new ParameterDefinition(pd.Name, pd.Attributes, target.Module.Import(pd.ParameterType.CloseGenericParameter(template, target)));
        }


        public static bool AreEquals(this Mono.Collections.Generic.Collection<ParameterDefinition> col1, Mono.Collections.Generic.Collection<ParameterDefinition> col2)
        {

            if (col1.Count != col2.Count)
                return false;

            for (int i = 0; i < col1.Count; i++)
                if (col1[i].ParameterType.ToString() != col2[i].ParameterType.ToString())
                    return false;

            return true;

        }




      
    }




}
